package com.csii.file.config;

import com.csii.core.constant.CommonConstant;
import com.csii.file.controller.FileController;
import com.csii.file.service.FileService;
import com.csii.file.util.MinioUtil;
import com.csii.file.util.OssBootUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * @Description TODO
 * @Date 2020/11/21 9:35
 * @Created by Ian
 * @Contact: 19107614@qq.com
 */
@Configuration
@Slf4j
@Import(FileController.class)
public class FileSystemConfiguration {
    @Bean
    @ConditionalOnProperty(name = "stdio.minio.minio_url")
    MinioConfig getMinioConfig(){
        return new MinioConfig();
    }
    @Bean
    @ConditionalOnProperty(name = "stdio.oss.endPoint")
    OssConfig getOssConfig(){
        return new OssConfig();
    }

    @Bean
    FileService getFileService(){
        return new FileService();
    }
}
